package heven.holt.library.di

import dagger.Module
import dagger.Provides
import dagger.hilt.EntryPoint
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import heven.holt.library.api.DownloadServer
import retrofit2.Retrofit
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
object ApiDownloadModule {
    @Provides
    @Singleton
    fun provideDownload(retrofit: Retrofit): DownloadServer {
        return retrofit.create(DownloadServer::class.java)
    }
}

@EntryPoint
@InstallIn(SingletonComponent::class)
interface DownloadProviderEntryPoint {
    fun provideDownload(): DownloadServer
}